<template>
  <textarea name="" class="file-content" v-model="file_content"></textarea>
</template>

<script>
import { ipcRenderer } from 'electron'
import { readFileSync } from 'fs'

export default {
  data() {
    return {
      file_content: '',
    }
  },
  mounted() {
    ipcRenderer.on('FILE_OPEN', (event, filePaths) => {
      this.file_content = readFileSync(filePaths[0])
    })
  },
}
</script>

<style scoped>
.file-content {
  display: block;
  width: 100vw;
  height: 100vh;
  border: none;
}
</style>